Repository navigation
refactor: every settings switch row is one SwitchRow component, and the descriptor table is gone - #2185
Merged
Conversation
…w component, and the descriptor table is gone
…he switch-row rule says why three files are excluded
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The fourth and last #2142 follow-up: every settings on/off row is one component.
storeis the shape every flag store already has (get().enabled,setEnabled,subscribe); the three stores that differ get a small adapter beside their page (message window: Tauri gate and the unified-chat lock,voice-page.ts; voice status and barge-in,listening-page.ts). Motion keepswhileOpenaround each store's subscribe.proactive/source-group.tsxtakes the row's props and builds the row itself.switch-row: ownerswitches/switch-row.tsx:SwitchRow;<Switchinsrc/ui/quick-controls/**/*.tsxoutside the owner. Baseline (settings rows not yet converted, refactor on touch):express-motion-section.tsx,idle-motion-section.tsx,perms-page-view.tsx,card-section.tsx,cue-list-group.tsx,plugin-group.tsx, one each. Excluded as other layouts:cue-row.tsx,characters-section.tsx,filler-section.tsx(the filler switch sits in its section head;FillerSectionnow reads its own store).Behaviour deltas:
wire-settings-window.ts:239).{ enabled }like every row (was{ on }; nothing reads it).Related issues
Closes #2142
Related decisions / docs
Owner decision on #2142 (latest comment): one shared switch-row component every page uses directly; the descriptor table is deleted.
docs/agent-guide/design/settings-row-switch.mdnames the component;docs/agent-guide/architecture/map.js:switch-row-switchreplacesdescriptor-switchandlistening-switch.Runtime evidence (required for UI / DOM / runtime behavior)
N/A beyond tests — the rows render the same DOM; the panel's suites pin it:
pnpm vitest run --project unit src/ui/quick-controls src/app/settings-window80 files, 1038 tests;quick-controls.layout.test.ts(each page's section order) unchanged; VRTquick-controls.fold.vrt.test.ts,quick-controls.narrow.vrt.test.ts,settings-panel.tabs.vrt.test.ts9/9.Merge danger
Tests
createSwitchRows, every assertion kept):switches/switch-row.test.tsx(wasdescriptor-row.test.tsx),proactive-page.test.tsx,together-page.test.tsx,filler-section.test.tsx,speaker-section.test.tsx;motion-page.test.tsxandcharacters-section.test.tsxdroprows.qc-toggles.test.ts: the case "renders the TTS switch with default aria-checked and clicking is a no-op when ttsSettings is absent" is removed (the inert row is gone); "places the one-voice switch in the Together page…" gainsttsSettingsin its setup, as production passes it.{labelIcon}from SwitchRow fails it); "renders no TTS row and no empty group without a TTS store" (rendering the group unconditionally fails it).Verification
pnpm buildpasses (includes tsc typecheck)pnpm testpassespnpm lintpasses (biome format + lint)cargo test/cargo clippypass (Rust changes) — nonepnpm gatesonce atce61d6eewithCONCEPT_RULES_CHANGE_OK=1: every gate exit 0; the two review-fix commits after it pass the focused unit, VRT, typecheck, biome, css, rules and map checks. Two independent reviews (spec: row-by-row parity; standards): approve.Checklist (YUI principles)
docs/reference/client-context.mdalongside the code (none)docs/agent-guide/architecture/map.jscarries every module, part, and exchange this PR adds, removes, or changes